package com.order.dao.bean;

import com.order.dao.DBUtil;

public class Waiter{
	public boolean delwaiter(String id){
		int c=0;
		if(id!=null){
			//String  sql="delete from orderinfo where w_id='"+id+"'";
			String sql1="delete from waiterinfo where w_id='"+id+"'";
			//a=DBUtil.UpdateUserInfo(sql);
			c=DBUtil.UpdateUserInfo(sql1);
			if(c>0)return true;
			else return false;
		}
		else
		  return false;
	}
	public  boolean insertwaiter(String id,String name,String password){
		String sql=null;
        sql=  "insert into waiterinfo values('"+id+"'";
	    sql+= ",'" + name + "','" + password +  "')";
	    System.out.println(sql);
	    int c=DBUtil.UpdateUserInfo(sql);
	    if(c>0)return true;
	    else 
	    	return false;
	    
	}
	
	public   boolean updatewaiter(String id,String name,String password)
    	{
		int c=0;
		String sql= "update waiterinfo set w_name='" + name +"',w_password='" + password + "' where w_id='"+id+"'";
		c=DBUtil.UpdateUserInfo(sql);
		System.out.println(sql);
		if(c>0)return true;
		else return false;
    	}
  // public static void main(String args[]){
	//   updatewaiter("6","ddd","ddd");
   //}
}